import React from "react";
import style from "./style.module.scss";

const icons = {
    info: 'tishi_',
    success: 'chenggong',
    warning: 'jinggao-',
    error: 'cuowu',
}

export default ({ type, content }) => {
  return (
    <div className={[`${style.toast_notice}`, `${style[type]}`].join(' ')}>
      <svg className="icon" aria-hidden="true">
        <use xlinkHref={`#icon-${icons[type]}`} />
      </svg>
      <span>{content}</span>
    </div>
  );
};
